<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title>CMS</title>
    <link href="__CSS__/common.css" rel="stylesheet"/>
    <link href="__CSS__/right.css" rel="stylesheet"/>
    <link rel="stylesheet" href="__INC__/form/css/zebra_form.css" type="text/css">
    <script type="text/javascript" language="javascript" src="__JS__/jquery-1.7.2.min.js"></script>
    <script type="text/javascript" language="javascript" src="__JS__/common.js"></script>
    <script type="text/javascript" language="javascript">
        $(document).ready(function () {
            $(".table_list tr").mouseover(function () {
                $(this).addClass("one");
            })
            $(".table_list tr").mouseout(function () {
                $(this).removeClass("one");
            })
        });
    </script>
    <style type="text/css">
        .one {
            background: #fcfcfc;
        }
        .Zebra_Form .row input.text2 {
            width: 1px
        }
    </style>
</head>
<body>
<!--右侧区域 begin-->
<div class="right">
    <!--当前位置 begin-->
    <include file='common:crumbs'/>
    <!--当前位置 end-->
    <!--主体区域 begin-->
    <div class="container">
        <div class="alert_div">
            <h4 class="alert_info"><span class="welcome">{$welcome}</span>您现在的位置是：{$current}</h4>
            <h4 class="alert_what" style="display:none;"></h4>
        </div>
        <!--样式一 begin-->
        <div class="stats">
            <div class="lm_title">
                <div class="lm_title_l"><em>自定义替换规则（正则表达式）</em></div>
            </div>
            <div class="lm_content">
                <div id="panel">
                    <div class="infos_left">
                        <table class="Zebra_Form">
                            <tr class="row">
                                <form name="form1" id="form1" action='__GROUP__/tpl/tplPreg' method="post">
                                    <td><input type="hidden" name="act" value="check"/></td>
                                    <td><label>输入替换规则:</label></td>
                                    <td></td>
                                    <td><input type="text" class="text" id="pregtext" name="preg" value="{$preg_str}"/></td>
                                    <td><input type="button" class="button" onclick="doAction('check');" value="分析"/></td>
                                </form>
                            </tr>
                            <tr class="row">
                                <form name="form2" id="form2" action='__GROUP__/tpl/tplPreg' method="post">
                                    <td><input type="hidden" name="act" value="replace"/></td>
                                    <td><label>输入替换内容:</label></td>
                                    <td><input type="hidden" class="text text2" id="pregtext_t" name="preg" value="{$preg_str}"/></td>
                                    <td><input type="text" class="text" name="preg2" id="preg2text" value="{$preg_str2}"/></td>
                                    <td><input type="button" class="button" onclick="doAction('replace');" value="执行替换"/></td>
                                </form>
                            </tr>
                        </table>
                    </div>
                </div>
            </div>
            <div class="lm_bottom">
                <div class="lm_bottom_l"><em></em></div>
            </div>
        </div>
        <!--样式一 end-->
        <!--样式三 begin-->
        <div class="stats">
            <div class="lm_title">
                <div class="lm_title_l"><em>替换分析结果</em></div>
            </div>
            <div class="lm_content">
                {$str}
            </div>
            <div class="lm_bottom">
                <div class="lm_bottom_l"><em></em></div>
            </div>
        </div>
        <!--样式三 end-->
    </div>
    <!--主体区域 end-->
</div>
<!--右侧区域  end-->
</body>
<script>
    function doAction(act) {
        var preg = $.trim($("#pregtext").val());
        if (preg == '') {
            jl_notify(3, "替换规则不能为空！");
            return false;
        }
        if (act == 'check') {
            $("#form1").submit();
        } else if (act == 'replace') {
            $("#pregtext_t").val(preg);
            $("#form2").submit();
        } else {
            jl_notify(3, "不知道你要干什么！");
            return false;
        }
    }
</script>
</html>